/** * Capitalizes the first character of a string. * * @param {string} s - The string to capitalize. * @returns {string} - The capitalized string. * @throws {TypeError} - If the input is not a string. */ export function capitalize(s) { if (typeof s !== 'string') { throw new TypeError('Input must be a string'); } if (s.length === 0) { return s; } return s[0].toUpperCase() + s.slice(1); }